execute if score #win anim_timer matches 100 as @a at @s run playsound block.beacon.deactivate master @s ~ ~ ~ 100000 0
execute if data storage vs:system temp.game{win_team:"red"} at @e[tag=TeamWoolDisplay,tag=blue,type=item_display] rotated 180 0 run tp @a[team=!] ^ ^ ^12.5 0 0
execute if data storage vs:system temp.game{win_team:"blue"} at @e[tag=TeamWoolDisplay,tag=red,type=item_display] rotated 0 0 run tp @a[team=!] ^ ^ ^12.5 180 0

execute if data storage vs:system temp.game{win_team:"red"} if score #win anim_timer matches 60..100 at @n[tag=TeamWoolDisplay,tag=blue,type=item_display] run particle portal ~ ~ ~ 0 0 0 3 20 normal
execute if data storage vs:system temp.game{win_team:"blue"} if score #win anim_timer matches 60..100 at @n[tag=TeamWoolDisplay,tag=red,type=item_display] run particle portal ~ ~ ~ 0 0 0 3 20 normal

execute if score #win anim_timer matches 20 as @e[tag=TeamWoolDisplay,type=item_display] at @s run function vs:system/game_ctrol/team_wool_display/kill

execute if data storage vs:system temp.game{win_team:"red"} if score #win anim_timer matches 15 run function vs:system/game/win_tips {win_team:"red",fail_team:"blue"}
execute if data storage vs:system temp.game{win_team:"blue"} if score #win anim_timer matches 15 run function vs:system/game/win_tips {win_team:"blue",fail_team:"red"}

execute if data storage vs:system temp.game{win_team:"red"} if score #win anim_timer matches -20 run function vs:system/game/red_win
execute if data storage vs:system temp.game{win_team:"blue"} if score #win anim_timer matches -20 run function vs:system/game/blue_win

scoreboard players remove #win anim_timer 1
execute if score #win anim_timer matches ..-21 run scoreboard players reset #win anim_timer